package com.springboot.ww.platform.pd.lms.dto;

import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.List;
import java.util.Map;

/**
 * 描述：
 *
 * @author 🧑 ‍wanwei
 * @since 2024-07-19 11:25
 */
@NoArgsConstructor
@Data
public class PddSizeChartDTO {


    @JsonProperty("result")
    private ResultDTO result;
    @JsonProperty("success")
    private Boolean success;
    @JsonProperty("requestId")
    private String requestId;
    @JsonProperty("errorCode")
    private Integer errorCode;
    @JsonProperty("errorMsg")
    private String errorMsg;

    @NoArgsConstructor
    @Data
    public static class ResultDTO {
        @JsonProperty("offset")
        private Integer offset;
        @JsonProperty("pageSize")
        private Integer pageSize;
        @JsonProperty("totalCount")
        private Integer totalCount;
        @JsonProperty("sizeSpecDataList")
        private List<SizeSpecDataListDTO> sizeSpecDataList;

        @NoArgsConstructor
        @Data
        public static class SizeSpecDataListDTO {
            @JsonProperty("contentDTO")
            private ContentDTODTO contentDTO;
            @JsonProperty("classId")
            private Integer classId;
            @JsonProperty("supplierId")
            private Long supplierId;
            @JsonProperty("businessId")
            private Long businessId;
            @JsonProperty("name")
            private String name;
            @JsonProperty("reusable")
            private Object reusable;
            @JsonProperty("updatedAt")
            private Long updatedAt;

            @NoArgsConstructor
            @Data
            public static class ContentDTODTO {
                @JsonProperty("records")
                private List<RecordsDTO> records;
                @JsonProperty("meta")
                private MetaDTO meta;

                @NoArgsConstructor
                @Data
                public static class MetaDTO {
                    @JsonProperty("elements")
                    private List<ElementsDTO> elements;
                    @JsonProperty("groups")
                    private List<GroupsDTO> groups;

                    @NoArgsConstructor
                    @Data
                    public static class ElementsDTO {
                        @JsonProperty("name")
                        private String name;
                        @JsonProperty("id")
                        private Integer id;
                    }

                    @NoArgsConstructor
                    @Data
                    public static class GroupsDTO {
                        @JsonProperty("name")
                        private String name;
                        @JsonProperty("id")
                        private Integer id;
                    }
                }

                @NoArgsConstructor
                @Data
                public static class RecordsDTO {
                    @JsonProperty("values")
                    private Map<String,String> values;
                }
            }
        }
    }
}
